package com.xjgzinfo.usdp.service.ext;

import com.xjgzinfo.lowcode.common.DataSourcePropertiesDTO;
import com.xjgzinfo.usdp.service.dto.BladeVisualDbDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface DataSourcePropertiesDTOMapper {
    DataSourcePropertiesDTOMapper INSTANCE = Mappers.getMapper(DataSourcePropertiesDTOMapper.class);

    @Mappings({
            @Mapping(source = "name", target = "name"),
            @Mapping(source = "url", target = "url"),
            @Mapping(source = "username", target = "username"),
            @Mapping(source = "password", target = "password"),
            @Mapping(source = "driverClass", target = "driverClass"),
            @Mapping(source = "status", target = "status"),
            @Mapping(source = "remark", target = "remark"),
            @Mapping(source = "isDeleted", target = "isDeleted"),
    })
    DataSourcePropertiesDTO do2do(BladeVisualDbDTO bladeVisualDbDTO);

    List<DataSourcePropertiesDTO> doList2doList(List<BladeVisualDbDTO> bladeVisualDbDTOS);
}